<!-- 发苗统计组件 -->
<template>
  <statistics-chart
    :api-path="apiPath"
    :status-colors="statusColors"
    :status-fields="statusFields"
    count-chart-title="发苗数量统计"
    area-chart-title="发苗面积统计(亩)"
  />
</template>

<script>
import StatisticsChart from '@/components/StatisticsChart.vue'

export default {
  name: 'SeedlingStatistics',
  components: {
    StatisticsChart
  },
  data() {
    return {
      apiPath: '/cultivate/stats/demand',
      
      // 状态颜色配置
      statusColors: [
        { key: 'pending', name: '待分配', color: '#f0a369' },
        { key: 'ordered', name: '已生成订单', color: '#8076a3' },
        { key: 'allocated', name: '已分配育苗点', color: '#5faee3' },
        { key: 'assignedDriver', name: '已分配司机', color: '#c29a82' },
        { key: 'delivering', name: '配送中', color: '#7bc86c' },
        { key: 'completed', name: '已完成', color: '#a27dd6' },
        { key: 'returned', name: '已退单', color: '#e9967a' },
        { key: 'cancelled', name: '已取消', color: '#757575' }
      ],
      
      // 状态字段映射
      statusFields: {
        pending: { count: 'pendingCount', area: 'pendingArea' },
        ordered: { count: 'orderedCount', area: 'orderedArea' },
        allocated: { count: 'allocatedCount', area: 'allocatedArea' },
        assignedDriver: { count: 'assignedDriverCount', area: 'assignedDriverArea' },
        delivering: { count: 'deliveringCount', area: 'deliveringArea' },
        completed: { count: 'completedCount', area: 'completedArea' },
        returned: { count: 'returnedCount', area: 'returnedArea' },
        cancelled: { count: 'cancelledCount', area: 'cancelledArea' }
      }
    }
  }
}
</script> 